import Foundation


struct UserItem {

    static var tableName: String = "users"

    let userId: String
    var fullName = ""
    let identityNumber: String
    var avatarUrl = ""
    var phone: String? = nil
    var isVerified = false
    var muteUntil: String? = nil
    var appId: String? = nil
    let createdAt: String?
    let relationship: String

    var role: String = ""
    var appDescription: String? = nil
    var appCreatorId: String? = nil

    var isMuted: Bool {
        guard let muteUntil = self.muteUntil else {
            return false
        }
        return muteUntil >= Date().toUTCString()
    }

    var isBot: Bool {
        guard let appId = self.appId else {
            return false
        }
        return !appId.isEmpty
    }
}
